package com.hps.shoping.good.controller;

import com.hps.shoping.good.entitys.Good;
import com.hps.shoping.good.service.GoodService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author heps
 * @date 2019/9/1 9:46
 */
@RestController
@RequestMapping("/goods")
public class GoodController {

    private final GoodService goodService;

    public GoodController(GoodService goodService) {
        this.goodService = goodService;
    }

    @GetMapping
    public List<Good> findAll() {
        return goodService.findAll();
    }
}
